Skip to content

Conversation

@CyMule
Copy link

@CyMule CyMule commented Jun 23, 2025

Problem

Explicitly set content types are taken as truth. Some clients such as curl set the content type based on the file extension which may not always be accurate.

Curl docs:

If the content-type is not specified, curl tries to guess from the file extension (it only knows a few), or use the previously specified type (from an earlier file if several files are specified in a list) or else it uses the default type application/octet-stream.

Solution

Always use the unstructured detect_filetype function to intelligently determine the file type instead of expecting the provided content type to be accurate.

@CyMule CyMule closed this Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants